<template>
  <view class="con">
  	<view class="answer">
  		<text class="bold">答案：</text>
  		<text>{{upPer(question.answer)}}</text>
  	</view>
  	<view class="explain">
  		<text class="bold">解析：</text>
  		<text>{{ question.analysis }}</text>
  	</view>
  	<view class="info">
  		<view class="right">
			
  			<text>正确：{{ question.dui ? question.dui : 0 }}次</text>
  		</view>
  		<view class="error">
  			
			
  			<text>错误：{{ question.cuo ? question.cuo : 0 }}次</text>
  		</view>
  		<view class="right-rate">
  			<text>正确率：{{Math.floor((question.cuo / (question.cuo + question.cuo)) * 100)}}%</text>
  		</view>
  	</view>
  </view>
</template>

<script>
export default {
	name: 'popUpError',
	props: {
			question:{
				type:Object
			}
	},
	methods:{
		
		upPer(str){
			if(str){
				return str.toUpperCase()
			}
		}
	}
}
</script>

<style lang="less" scoped>
	.con {
		padding: 0 20rpx;
		text-align: left;
		line-height: 1.5em;
		margin-top: 15rpx;
		.bold {
			font-weight: bold;
		}
		.answer {
			color: red;
		}
		.explain {
			text-align:justify;
			padding:15rpx 0;
			border-bottom: 1px dashed #e0e0e0;
			max-height:700rpx;
			overflow: scroll;
		}
		.info {
			margin-top: 15rpx;
			display:flex;
			flex-wrap: wrap;
			justify-content: space-between;
			.right{
				width:50%;
			}
			.error{
				width:50%;
			}
			.right-rate{
				margin-top: 10rpx;
				width:100%;
				text-align: center;
			}
		}
	}
</style>